<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>RaiseError</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">RaiseError()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#006666"><b>RaiseError</b></font>(ErrorNumber)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Artificially create the given error. The appropriate error action will be taken (call of the error handler 
or program termination by the system if no handler is set). The ErrorNumber will be available inside the 
error handler with the <a href="errorcode.html">ErrorCode()</a> command. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>ErrorNumber</i></td>
<td width="90%"> 
 
On Windows, the error number can include application defined errors. The value can be between 0 and 268435455 (a 27bit number). 
On Linux or Mac OSX, only the following errors can be raised: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_OnError_InvalidMemory</font>         : Read or write operation on an invalid location
  <font color="#924B72">#PB_OnError_Floatingpoint</font>         : Floating-point error
  <font color="#924B72">#PB_OnError_Breakpoint</font>            : Debugger breakpoint reached (non-PureBasic breakpoints)
  <font color="#924B72">#PB_OnError_IllegalInstruction</font>    : Attempt to execute an illegal instruction
  <font color="#924B72">#PB_OnError_PriviledgedInstruction</font>: Attempt to execute a privileged (system-) instruction
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

None.





</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Procedure</font></b> <font color="#006666">ErrorHandler</font>()
<font color="#006666">    MessageRequester</font>("OnError test", "The following error happened: " +<font color="#006666"> ErrorMessage</font>())
  <b><font color="#006666">EndProcedure</font></b>

<font color="#006666">  MessageRequester</font>("OnError test", "Test start")

<font color="#006666">  OnErrorCall</font>(@ErrorHandler())
<font color="#006666">  RaiseError</font>(<font color="#924B72">#PB_OnError_InvalidMemory</font>)
  
<font color="#006666">  MessageRequester</font>("OnError test", "This should never be displayed")
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="errorcode.html">ErrorCode()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=onerrorgoto.html>OnErrorGoto()</a> - <a href=index.html>OnError Index</a>

</body></html>